Define = {
    "TIME": "timestamp",
    "TYPE": "vehicleType",
    "GANTRY": "sn",
    "PLATE": "plateNumber"
}

# time_interval、car_pass_time暂时未使用
ConfigData = {
    "kafka_host": "10.102.1.113:9092",
    "kafka_cars_topic": "kako_data",
    "kafka_event_index_topic": "EVENT_INDEX_DATA_CHANNEL",
    "kafka_event_topic": "event_data",
    "kafka_event_index_history_topic": "EVENT_INDEX_DATA_HISTORY_CHANNEL",
    "kafka_monitor_topic": "event_monitor",
    "kafka_status": "device_up_status",
    "kafka_all_status": "online_analysis_result",
    "format_str": "%Y-%m-%dT%H:%M:%S.%f",
    "threshold": {
        "flow": 0.33,
        "speed": 0.4,
        "pass_rate": 70,
        "slow_num": 5,
        "car_speed_l1": 40,
        "car_speed_l2": 30,
        "car_speed_l3": 20,
    },
    "congestion_flag": False,
    "radar_flag": False,
    "lidar_topic_dict": {
        "RADAR_144_TOPIC": "leida_source_10.143.187.144",
        "RADAR_149_TOPIC": "leida_source_10.143.187.149",
        "RADAR_153_TOPIC": "leida_source_10.143.187.153",
        "RADAR_157_TOPIC": "leida_source_10.143.187.157",
        "RADAR_161_TOPIC": "leida_source_10.143.187.161",
        "RADAR_165_TOPIC": "leida_source_10.143.187.165",
        "RADAR_168_TOPIC": "leida_source_10.143.187.168",
        "RADAR_171_TOPIC": "leida_source_10.143.187.171",
        "RADAR_174_TOPIC": "leida_source_10.143.187.174",
    },
    "radar_topic_dict": {
        "RADAR_132_TOPIC": "leida_source_10.143.187.132",
        "RADAR_136_TOPIC": "leida_source_10.143.187.136",
        "RADAR_140_TOPIC": "leida_source_10.143.187.140",
        "RADAR_197_TOPIC": "leida_source_10.151.98.197",
        "RADAR_254_TOPIC": "leida_source_10.151.98.254",
        "RADAR_113_TOPIC": "leida_source_10.151.106.113",
        "RADAR_116_TOPIC": "leida_source_10.151.106.116",
    },
    "route": [["10001", "10002", "10003", "10005", "10006"]],
    "all_time_interval": 5,
    "gantry_info": {
        "10001": {
            "up_gantry_id": "HW7",
            "down_gantry_id": "TLS_1_1",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1,
            "time_move": 0.5,
            "dist": 2.01,
            "car_pass_time": 2,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 0
        },
        "10002": {
            "up_gantry_id": "TLS_1_1",
            "down_gantry_id": "TLS_1_2",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1,
            "time_move": 0.5,
            "dist": 1.80,
            "car_pass_time": 2,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 0
        },
        "10003": {
            "up_gantry_id": "TLS_1_2",
            "down_gantry_id": "TLS_2_1",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1.5,
            "time_move": 0.5,
            "dist": 1.66,
            "car_pass_time": 3,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 0
        },
        "10004": {
            "up_gantry_id": "TLS_2_1",
            "down_gantry_id": "TLS_2_2",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1,
            "time_move": 0.5,
            "dist": 1.80,
            "car_pass_time": 1.8,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 0
        },
        "10005": {
            "up_gantry_id": "TLS_2_2",
            "down_gantry_id": "ZW4",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1.5,
            "time_move": 0.5,
            "dist": 3.25,
            "car_pass_time": 2.5,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 1
        },
        "10006": {
            "up_gantry_id": "ZW4",
            "down_gantry_id": "ZW3",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1.5,
            "time_move": 0.5,
            "dist": 0.90,
            "car_pass_time": 2.5,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 0
        },
        "10007": {
            "up_gantry_id": "ZW3",
            "down_gantry_id": "HW3",
            "direction": 0,
            "lane_num": 2,
            "time_interval": 1.5,
            "time_move": 0.5,
            "dist": 3.30,
            "car_pass_time": 2.5,
            "car_max_speed": 100,
            "car_min_speed": 70,
            "is_fork": 0
        }
    }
}

KakoList = [
    {
        'pileNumber': 'ZW3',
        'ip': '10.151.110.120',
        'RealPileNumber': 'K1660+980',
        'type': '中维',
        'lon': 106.92890390995352,
        'lat': 30.31307726368321
    },
    {
        'pileNumber': 'ZW4',
        'ip': '10.151.110.124',
        'RealPileNumber': 'K1660+130',
        'type': '中维',
        'lon': 106.93466252112233,
        'lat': 30.30702300212657
    },
    {
        'pileNumber': 'HW3',
        'ip': '10.151.98.252',
        'RealPileNumber': 'K1664+275',
        'type': '华为',
        'lon': 106.90486404258229,
        'lat': 30.332586944635906
    },
    {
        'pileNumber': 'HW7',
        'ip': '10.151.106.111',
        'RealPileNumber': 'K1649+740',
        'type': '华为',
        'lon': 107.01872652727303,
        'lat': 30.253464707956567
    },
    {
        'pileNumber': 'TLS_1_1',
        'ip': '10.151.106.111',
        'RealPileNumber': 'K1651+749',
        'type': '大华1',
        'lon': 107.00045594,
        'lat': 30.26102627
    },
    {
        'pileNumber': 'TLS_1_2',
        'ip': '10.151.106.111',
        'RealPileNumber': 'K1653+549',
        'type': '大华2',
        'lon': 106.98796104,
        'lat': 30.27166376
    },
    {
        'pileNumber': 'TLS_2_1',
        'ip': '10.151.106.111',
        'RealPileNumber': 'K1655+154',
        'type': '大华3',
        'lon': 106.97537802,
        'lat': 30.28234155
    },
    {
        'pileNumber': 'TLS_2_2',
        'ip': '10.151.106.111',
        'RealPileNumber': 'K1656+840',
        'type': '大华4',
        'lon': 106.96261914,
        'lat': 30.29332086
    }
]
